#ifndef __M_MSG_H__
#define __M_MSG_H__
#include "util.hpp"
#include "level.hpp"
#include <thread>
#include <memory>

namespace mylog{
struct LogMsg {
    using ptr = std::shared_ptr<LogMsg>;
    size_t _line;//行号
    size_t _ctime;//时间
    std::thread::id _tid;//线程ID
    std::string _name;//日志器名称
    std::string _file;//文件名
    std::string _payload;//日志消息
    LogLevel::value _level;//日志等级
    LogMsg(LogLevel::value level,size_t line, const std::string file, const std::string name,const std::string payload)
         :_name(name),
         _file(file),
         _payload(payload), 
         _level(level),
         _line(line),
         _ctime(util::Date::now()),
         _tid(std::this_thread::get_id()) {
        }
    ~LogMsg(){}
};
}

#endif